home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13149 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  53 lines

  1. Path: sun001.spd.dsccc.com!jmccarty
  2. From: jmccarty@sun1307.spd.dsccc.com (Mike McCarty)
  3. Newsgroups: comp.programming,comp.sys.sgi.misc,comp.lang.c
  4. Subject: Re: C pointer question.
  5. Date: 4 Apr 1996 22:53:38 GMT
  6. Organization: DSC Communications Corporation
  7. Message-ID: <4k1jti$igm@sun001.spd.dsccc.com>
  8. References: <315BFDBB.773C@wight.hursley.ibm.com> <31616BAF.5BAB@datalytics.com> <3162659B.6201@wight.hursley.ibm.com> <4ju6c5INN2ee@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: sun1307.spd.dsccc.com
  10.  
  11. In article <4ju6c5INN2ee@keats.ugrad.cs.ubc.ca>,
  12. Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
  13. )In article <3162659B.6201@wight.hursley.ibm.com>,
  14. )Max Waterman  <dwater@wight.hursley.ibm.com> wrote:
  15. )>Ie what are the arguments for :
  16. )>
  17. )>char    name1,
  18. )>    name2,
  19. )>    name3;
  20. )>
  21. )>over :
  22. )>
  23. )>char name1;
  24. )>char name2;
  25. )>char name3;
  26. )>
  27. )>?
  28. )>
  29. )>Aren't they identical?
  30. )>
  31. )>Any compiler boffs out there know about this?
  32. )
  33. )These are identical. But if you put too many declarators onto one declaration
  34. )specifier string, an ANSI-compliant compiler may fail, because the standard
  35. )says that a compiler is only required to process declarations that have at
  36. )least 12 (AFAIR) declarators (if I interpreted the confusing paragraph
  37. )correctly: I'm sure this article will be followed up with some clarifications
  38. )and/or flames). This might be intended as a relief to parsers that build n-ary
  39. )trees, where the number of children that a parse tree node can have is a fixed
  40. )array contained in the node data structure:
  41.  
  42. They are not guaranteed to be identical. I haven't seen anything in the
  43. standard that says that the same program must be produced by these
  44. differing sources. I have, in fact, used compilers which -did- produce
  45. different programs depending on such declarations.
  46.  
  47. Mike
  48. -- 
  49. ----
  50. char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
  51.  
  52. I don't speak for DSC.         <- They make me say that.
  53.